package com.baosight.xCyber;

import java.sql.Timestamp;

/**
 * time与long之间转换的工具类
 * @author wuqihang
 */
public class TimeConvertUtil {
    public static String longToTime(Long second){
        if(second==null){
            return null;
        }
        Timestamp timestamp = new Timestamp(second);
        return timestamp.toString();
    }

    public static Long timeToLong(String timeStr){
        if(timeStr == null){
            return null;
        }
        Timestamp timestamp = Timestamp.valueOf(timeStr);
        Long second = timestamp.getTime();
        return second;
    }


}
